{% extends "base_site" %}

{% block coltype %}colMS{% endblock %}
{% block bodyclass %}dashboard{% endblock %}
{% block breadcrumbs %}{% endblock %}
{% block content %}
<div id="content-main">

{% load adminapplist %}

{% get_admin_app_list as app_list %}
{% for app in app_list %}
    <div class="module">
    <h2>Application {{ app.name|lower }}</h2>
    <table>
    {% for model in app.models %}
        <tr>
            <th><a href="{{ model.admin_url }}">Objets "{{ model.name|lower }}"</a></th>
            <td class="x50"><a href="{{ model.admin_url }}add/" class="addlink">Ajouter</a></td>
            <td class="x75"><a href="{{ model.admin_url }}" class="changelink">Modifier</a></td>
        </tr>
    {% endfor %}
    </table>
    </div>
{% endfor %}

</div>
{% endblock %}

{% block sidebar %}
<div id="content-related">
    <div class="module" id="recent-actions-module">
        <h2>Actions effectuées récemment</h2>
        <h3>Mes dernières actions</h3>
            {% load auth.log %}
            {% get_admin_log 10 as admin_log for_user user %}
            {% if not admin_log %}
            <p>Aucune action entreprise récemment</p>
            {% else %}
            <ul class="actionlist">
            {% for entry in admin_log %}
                <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">{% if not entry.is_deletion %}<a href="{{ entry.get_admin_url }}">{% endif %}{{ entry.object_repr }}{% if not entry.is_deletion %}</a>{% endif %}<br /><span class="mini quiet">{{ entry.get_content_type.name|capfirst }}</span></li>
            {% endfor %}
            </ul>
            {% endif %}
    </div>
</div>
{% endblock %}
